home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_oth / mini4th / zen-mini.fil < prev   
Text File  |  1988-09-14  |  5KB  |  104 lines

  1.     September 14, 1988 
  2.  
  3.     Jerry: 
  4.  
  5.     The three files on this disk are the result of my starting to "reverse
  6.     engineer" Martin Tracy's ZEN forth to create source code.  After
  7.     getting into it, I became quite discouraged with his multitude of
  8.     headerless words (both code and otherwise).  In addition, I found a
  9.     serious bug in the way he handles DO and LOOP.  
  10.  
  11.     If one is compiling a DO-LOOP construct that requires more than one
  12.     line (either from a disk file or from the keyboard), the program goes
  13.     away and the computer locks up.  This is due to the way Martin uses the
  14.     return stack for handling addresses for his immediate LEAVE function.
  15.     Unfortunately he needed to remove one more level from the return stack,
  16.     but didn't.  MINIforth takes care of this problem.  
  17.  
  18.     A second major bug in ZEN is the 64-byte keyboard buffer.  You can't
  19.     even type in a full screen line while compiling!  There's no warning
  20.     when you fill the TIB, so you can easily 'crash' while defining words.
  21.     And, because of the placement of the TIB (between the two stacks), it
  22.     cannot easily be increased in size.  Again, MINIforth takes care of
  23.     this problem.  Like ZEN, it uses DTC and keeps TOS in a register for
  24.     very fast execution.  
  25.  
  26.     You can have MINIforth, including the source code, for use on your
  27.     board, if you'd like.  I am presently up to version 2.5, and I think
  28.     that will be it.  Anyone interested in getting updated versions can
  29.     call or write me.  I have extensions to the MINI.MIN file that add more
  30.     standard words, but have not yet begun the tutorial promised.  That
  31.     will come.  
  32.  
  33.     As indicated in the source code file, MINI is rather radical and may
  34.     not appeal to true FORTHers, as it makes extensive use of TO variables.
  35.     From an execution and readability point of view, however, the TO
  36.     variables appear to me to be the way to go.  Consider the statement: 
  37.  
  38.                                 STATE @ IF 
  39.  
  40.     and compare it to the MINI equivalent: 
  41.  
  42.                               COMPILING IF 
  43.  
  44.     In addition to eliminating the fetch operator, it "reads" better, and
  45.     executes faster.  This is what I like about this type of variable.  You
  46.     might also consider use of perhaps the most often used FORTH word --
  47.     HERE.  In most FORTHs, this is a high-level word : 
  48.  
  49.                               : HERE DP @ ; 
  50.  
  51.     that uses a user variable and a code word (plus the overhead of DOCOLON
  52.     and EXIT).  In MINIforth, HERE is the dictionary pointer, a user TO
  53.     variable, thus much faster execution, etc.  
  54.  
  55.     Anyway, enough defense of my version of MINIforth.  Here are some
  56.     additional "features" of it.  
  57.  
  58.     1.  It is written to run on 808X machines under MS-DOS or PC-DOS.  As
  59.     such, it takes full advantage of the resources afforded by DOS, and
  60.     doesn't re-invent everything.  For example, KBD is the code word that
  61.     does effectively what EXPECT does in other FORTHs, but MINI uses the
  62.     DOS buffered keyboard input service.  This gives the user all the
  63.     features found at the DOS prompt for command line editing (using the
  64.     function keys, INS, DEL, etc.).  In addition, the extended version will
  65.     access "screens" as ASCII files, which one can create using any sort of
  66.     text editor.  There will be no EDITOR as a result (unless one wants to
  67.     make one, that is).  
  68.  
  69.     2.  It was NOT written with the intention of having code ultimately
  70.     being put into ROM (i.e.  the "toaster").  However, it WAS written with
  71.     the idea in mind of being able to do target compiling to create a
  72.     standalone disk application program.  It is easily de-compilable,
  73.     including code words.  Kernal words are grouped together at the very
  74.     beginning of the program.  In-line code words have a byte-count
  75.     imbedded in them so the de-compiler can find the end for relocation.
  76.     User variables (often referenced by code words) are also fixed at the
  77.     beginning of the program, making code words relocatable.  User
  78.     variables, TIB and kernal words amount to about 830 btes -- a VERY
  79.     tight little package!  
  80.  
  81.     Later versions also include a small system stack that operates almost
  82.     as fast as a "real" stack, and that is included 'up front' with the
  83.     kernal code and user variables.  
  84.  
  85.     3.  With the right help, MINI can handle multi-users and multitasking.  
  86.     
  87.     4.  MINI has the kernal code needed to implement Eakers' CASE words.
  88.     This is the 'of' word that does essentially OVER = IF DROP in code.  It
  89.     needs CASE, OF, ENDOF, and ENDCASE to make it work.  These will be
  90.     provided in later files of MINI.MIN.  
  91.  
  92.  
  93.     So, I guess that's it.  I have had fun creating MINIforth, and it could
  94.     be used by almost anyone to learn and/or use FORTH for whatever
  95.     reasons.  Enjoy.  
  96.  
  97.                                           Ted Beach 
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.